<!DOCTYPE html>
<html lang="en">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>任务信息</title>
 		      <script type="text/javascript"   th:src="@{/js/jquery.min.js}"></script>

<script  th:inline="javascript">
    
    	var taskId = [[${taskId}]];
    	
    </script>
</head>
<body>
   
   
   <div id="xs">

		   		<p>审批页面</p>
		   	
		   		<p>请假单ID:</p><input type="text" id="id" name="id"/> 
		   		<p>状态:</p><input type="text" id="status" /> 
		   		<p>备注:</p><input type="text" id="leaveMsg" /> 
		   		<p>请假天数:</p><input type="text" id="days" /> 
		   		<p>任务单ID:</p><input type="text" id="taskId" /> 
		   		<p>用户ID:</p><input type="text" id="userId" /> 
		   		
		   		<p>历史审批记录</p><input type="text" id="h" />
		   		
			   	<p>审批意见</p><input type="text"  id="spyj" ></input>
		   		
		   		<div style="margin-top:50px;">
			   		<input type="button" value="同意" id="pass" onclick="pass();"></input>
			   		<input type="button" value="拒绝" id="reject" onclick="reject();"></input>
		   		</div>
		   		
  		</div>
  		
  		
  		<div id="sp" style="margin-top:50px;">
   
			<form id="shenpi" action="/workflow/completeTask" method="post" >
			

			
		   		<input type="hidden" name="userId" id="suserId"/> 
		   		<input type="hidden" name="taskId" id="staskId"/> 
		   		<input type="hidden" name="outcome" id="soutcome"/> 
		   		<input type="hidden" name="comment" id="scomment"/> 
			</form>

  		</div>
  		
  		
  		
  		<script  th:inline="javascript">
    	var id = [[${id}]];
    	var leaveMsg = [[${leaveMsg}]];
    	var days = [[${days}]];
    	var status = [[${status}]];
    	var userId = [[${userId}]];
    	var taskId = [[${taskId}]];
    	
    	var h = [[${history}]];
    	console.log(h);
    	
    	$("#id").attr("value", id);
    	$("#userId").val(userId);
    	$("#days").val(days);
    	$("#status").val(status);
    	$("#leaveMsg").val(leaveMsg);
    	$("#taskId").val(taskId);
    	$("#h").val(h);
    	
    	//存入storage
    	var storage=window.localStorage;
    	storage["taskId"]=taskId;
    	
    	 function pass(){
    		
    		 $("#staskId").val(storage.taskId);
    		 $("#suserId").val(1);
    		 $("#soutcome").val("同意");
    		 $("#scomment").val( $("#spyj").val());
    		 $("#shenpi").submit(); 
     	}
    	
    	 function reject(){
    		 $("#staskId").val(storage.taskId);
    		 $("#suserId").val(1);
    		 $("#soutcome").val("不同意");
    		 $("#scomment").val( $("#spyj").val());
    		 $("#shenpi").submit(); 
     	}
    	
    </script>
</body>

</html>